Enhancing residential energy access with optimized stand-alone hybrid solar-diesel-battery systems in Buea, Cameroon

This study examined the optimal size of an autonomous hybrid renewable energy system (HRES) for a residential application in Buea, located in the southwest region of Cameroon. Two hybrid systems, PV-Battery and PV-Battery-Diesel, have been evaluated in order to determine which was the better option. The goal of this research was to propose a dependable, low-cost power source as an alternative to the unreliable and highly unstable electricity grid in Buea. The decision criterion for the proposed HRES was the cost of energy (COE), while the system’s dependability constraint was the loss of power supply probability (LPSP). The crayfish optimization algorithm (COA) was used to optimize the component sizes of the proposed HRES, and the results were contrasted to those obtained from the whale optimization algorithm (WOA), sine cosine algorithm (SCA), and grasshopper optimization algorithm (GOA). The MATLAB software was used to model the components, criteria, and constraints of this single-objective optimization problem. The results obtained after simulation for LPSP of less than 1% showed that the COA algorithm outperformed the other three techniques, regardless of the configuration. Indeed, the COE obtained using the COA algorithm was 0.06%, 0.12%, and 1% lower than the COE provided by the WOA, SCA, and GOA algorithms, respectively, for the PV-Battery configuration. Likewise, for the PV-Battery-Diesel configuration, the COE obtained using the COA algorithm was 0.065%, 0.13%, and 0.39% lower than the COE provided by the WOA, SCA, and GOA algorithms, respectively. A comparative analysis of the outcomes obtained for the two configurations indicated that the PV-Battery-Diesel configuration exhibited a COE that was 4.32% lower in comparison to the PV-Battery configuration. Finally, the impact of the LPSP reduction on the COE was assessed in the PV-Battery-Diesel configuration. The decrease in LPSP resulted in an increase in COE owing to the nominal capacity of the diesel generator.

www.nature.com/scientificreports/stability.Power outages, load shedding, and voltage drops are common on the electrical grid, causing significant social and economic consequences for the population.In 2021, Cameroon's power network experienced an average system interruption duration index (SAIDI) of 162.6 h and an average system interruption frequency index (SAIFI) of 41.8 2 .These two indices assess the reliability of Cameroon's power grid, highlighting its inferior performance compared to more advanced countries such as the United States, where the SAIDI was 4.7 h in 2019 3 .Renewable energies, particularly solar photovoltaic energy, are critical for expanding the population's access to electricity in a sustainable basis.PV systems produce decarbonized and environmentally friendly electricity, which helps fight global warming.Cameroon has significant solar photovoltaic (PV) potential across its territory.The annual mean solar radiation varies across the country, with the north receiving 5.8 kWh/m 2 and the south receiving 4.9 kWh/m 2 4,5 .Utilizing this significant potential could allow for both large-scale energy production for grid-connected systems and smaller, stand-alone systems.However, solar energy is not a panacea for Cameroon's lack of access to high-quality energy.Solar panel output is highly dependent on the erratic nature of both solar radiation and ambient temperature, which frequently leads to an imbalance between supply and demand.In order to mitigate this issue, storage systems are interconnected with photovoltaic systems to ensure the uninterrupted provision of energy to diverse loads in the event of solar panel failure.Furthermore, adding supplementary power sources, such as diesel generators, can improve the HRES's reliability.The incorporation of diverse energy sources and storage systems into renewable energy systems significantly impacts the expenses associated with their installation, operation, and maintenance.So, to be appealing, these renewable energy systems must be optimally dimensioned in order to reduce the investment required for installation.This work developed an optimal sizing approach for a HRES composed of batteries, solar panels, and a diesel generator for a residential application in Buea, Cameroon's southwest region.The system is intended to operate independently of the electrical grid.

Related works
The literature extensively discusses the optimal design of Hybrid Renewable Energy Systems (HRESs), which integrate various energy sources such as solar panels, wind turbines, diesel generators, biogas generators, and storage systems.These systems are designed to provide a reliable and sustainable energy supply by leveraging the complementary nature of different energy sources.For instance, solar panels generate electricity during the day, while wind turbines can produce power both day and night, depending on wind conditions.Diesel and biogas generators serve as backup power sources, ensuring a continuous energy supply even when renewable sources are insufficient.
Determining the appropriate size and configuration of these HRESs is a complex task that involves balancing cost, efficiency, and reliability.Effective methods for sizing these systems often utilize advanced software tools like HOMER (Hybrid Optimization of Multiple Energy Resources) 6,7 .HOMER allows users to simulate and optimize the performance of various HRES configurations under different scenarios, helping to identify the most cost-effective and reliable setup 8 .
Additionally, metaheuristic algorithms, such as genetic algorithms, particle swarm optimization, and simulated annealing, are frequently employed to solve the optimization problems associated with HRES design 9,10 .These algorithms can efficiently search through large solution spaces to find near-optimal configurations that might be impractical to identify through traditional methods 11 .By combining these tools and techniques, researchers and engineers can design HRESs that meet specific energy demands, minimize costs, and enhance sustainability.
Al-Shamma'a et al. 12 conducted an investigation to look into the possibility of transitioning from diesel-powered to hybrid energy systems in remote areas of Saudi Arabia.This study proposes using PV and wind turbines to reduce costs and increase the use of energy from renewable sources.The researchers used an optimization framework with a genetic algorithm to determine the most efficient hybrid system, taking into account factors such as solar panel rated power, wind turbine nominal power, battery count, and diesel generator rated capacity.The study found that a PV/battery/diesel system is the most cost-effective option for remote locations.Finally, an HRES with PV/battery/diesel saved approximately 60% of fuel compared to a diesel-only system while lowering carbon emissions by approximately 43%.
Rashid et al. 13 sought to develop and assess the feasibility of hybrid energy systems that incorporate biomass energy sources in a remote part of Bangladesh.The study looked at different hybrid system configurations, optimized their sizing and components, and evaluated their techno-economic aspects using a genetic algorithm.The findings show that a solar-based photovoltaic (PV) system with wind, diesel, and biomass backup sources has the lowest levelized cost of energy (LCOE).Furthermore, the study demonstrates that the genetic algorithm (GA) method delivers long-term and cost-effective results when contrasted with HOMER Pro software.
As reported by Ferrari et al. 14 , HRESs have the potential to reduce supply costs and incorporate renewable energy sources for remote off-grid users.By implementing a new sizing strategy for hybrid PV-wind-diesel systems that considers real-world constraints and machine data, the authors were able to optimize the energy mix configurations.This study contributes to the development of dependable techniques for designing hybrid systems, including renewables, energy-storage batteries, and fossil fuel generators.Olatomiwa et al. 15 found that the PV/diesel/battery combination was the most economically feasible choice, exhibiting the smallest fuel consumption and CO 2 emissions.
Makhdoomi and Askarzadeh 16 performed an investigation to assess the techno-environmental feasibility of various HRESs, such as PV/diesel, PV/diesel/battery, and PV/diesel/pumped hydro storage (PHS) configurations.The optimization problem involved two objective functions: LCOE and total primary energy (TPE).The optimal results were determined using multi-objective crow search algorithm (MOCSA).The study indicated that the most economical choice was a PV/diesel/PHS system utilizing fixed panels.Olatomiwa et al. 17 assessed the most suitable dimensions of HRES in various off-grid locations to power healthcare facilities in rural areas of Nigeria.The renewable energy systems considered in this study include solar PV, wind turbines, diesel generators, and storage batteries.The HOMER software was utilized for High Renewable Energy Systems (HRES) sizing.The optimal results revealed that for some locations, the PV-wind-diesel-battery configuration was optimal, while for others, the PV-diesel-battery configuration was most appropriate.This research 18 aimed to conduct an extensive technical and economic evaluation to determine the best approach for hybrid photovoltaic/wind systems integrating various types of energy storage to provide electricity to three particular areas in Cameroon: Fotokol, Figuil, and Idabato.The study utilized the cuckoo search algorithm to identify the optimal hybrid system combination with the cheapest cost of energy and net present cost, while ensuring it meets the load deficit probability.The findings indicated that a battery-based photovoltaic/wind HRES is the most efficient, economical, and dependable configuration for all levels of activity and locations.The researchers in this study 19 sized and analyzed stand-alone HRES that included PV modules and/or wind turbines in Cameroon's Far North region, where many rural areas lack access to electricity.An analysis of sensitivity was conducted to assess the performance of HRES by examining different parameters such as LPSP, surplus energy ratio, and level of self-sufficiency.Optimization algorithms constitute popular and effective methods to figure out the optimal size of HRES.The Cuckoo Optimization Algorithm (COA) metaheuristic, despite being relatively new, has been successfully applied to solve numerous intricate engineering problems because of its simplicity and resilience 20,21 .This algorithm is inspired by the brood parasitism of some cuckoo species and is known for its ability to find optimal solutions efficiently in complex problem spaces 22 .
In addition to COA, other metaheuristic methods such as the Whale Optimization Algorithm (WOA), Sine Cosine Algorithm (SCA), and Grasshopper Optimization Algorithm (GOA) have demonstrated their effectiveness in addressing HRES sizing issues 23,24 .These algorithms mimic natural processes and behaviors to explore and exploit search spaces, making them highly suitable for optimizing the design and operation of Hybrid Renewable Energy Systems 25,26 .Each of these methods brings unique strengths; for instance, WOA mimics the bubble-net hunting strategy of humpback whales, SCA leverages mathematical sine and cosine functions to navigate the search space, and GOA is inspired by the swarming behavior of grasshoppers 27 .Their application to HRES design helps in achieving balanced, efficient, and sustainable energy systems.
Based on insights gained from an extensive review of the current literature, this study reveals a key gap in solving the energy challenges faced by residential areas in Buea, Cameroon.Despite the abundance of renewable energy resources, the region continues to grapple with an unreliable and unstable electricity grid, leading to frequent power outages and hindered socio-economic development.Existing studies have highlighted the potential of Hybrid Renewable Energy Systems (HRES) to mitigate these issues by harnessing solar energy alongside other renewable sources.
However, the literature reveals a lack of comprehensive research focused on optimizing the design and configuration of HRES specifically tailored for the residential context in Buea.Existing studies often overlook the unique socio-economic and environmental dynamics of the region, thus failing to provide practical solutions that address the specific needs and constraints of local residents.Furthermore, the existing energy management strategies in Buea primarily rely on traditional fossil fuel-based generators as backup power sources, contributing to environmental degradation and exacerbating the region's vulnerability to climate change impacts.There is a pressing need for innovative, sustainable alternatives that not only ensure reliable energy access but also minimize greenhouse gas emissions and promote resilience in the face of evolving environmental challenges.
Therefore, the research problem addressed in this study revolves around the formulation of an optimal HRES configuration that balances cost-effectiveness, reliability, and environmental sustainability.By integrating insights from the literature review with empirical data and advanced optimization techniques, this research aims to contribute a tailored solution to the energy challenges faced by residential communities in Buea.The study seeks to bridge the gap between theoretical knowledge and practical implementation, thereby offering valuable insights for policymakers, energy planners, and stakeholders involved in sustainable development initiatives in the region.

Objective of the study
This study sought to figure out the optimal dimension of an autonomous PV/Battery/Diesel hybrid system for residential use in Buea, Cameroon, with the goal of enhancing the community's access to dependable and quality energy.This study utilized the cost of energy as a decision criterion and the loss of power supply probability as a system dependability criterion.

Research contributions of the work
This work makes the following contributions to the literature: 1.A PV/Battery/Diesel hybrid system was suggested for residential use in Buea, southwest Cameroon.An energy management approach has been proposed to boost the proportion of renewable energy in order to meet demand and restrict greenhouse gas emissions.2. The suggested HRES's size was optimized using the COA meta heuristic in accordance with LPSP and energy cost criteria.Following that, the results were examined in relation to those given by the WOA, SCA, and GOA algorithms.3. A comparison was conducted between PV/Battery/Diesel and PV/Battery configurations to identify the most efficient configuration according to cost of energy and LPSP.4. A thorough examination was conducted to assess the impact of gradually decreasing the LPSP on energy costs and the capacity of diesel generators.The purpose was to analyze how enhancing the reliability of the proposed hybrid system would affect the cost of energy. www.nature.com/scientificreports/ The next sections of this study follow a systematic framework: Section "Materials and method" elaborates on the materials and methodology used, outlining the methods and techniques applied.Section "Result and discussion" carefully examines the obtained results, providing a thorough analysis of the findings.Finally, Section "Conclusion and future research directions" summarizes the study's findings, combining the insights gained from previous parts.

Load assessment
Buea is the capital of Cameroon's Southwest region, located at latitude 4°14″ north and longitude 9°20″ east.The University of Buea, situated in the city, is one of the nation's top institutions.The city has a significant student population, most of whom reside in private dormitories located near the university.The energy consumption profile of this private university residence, located next to the University of Buea, varies depending on the time period considered.When the university was open, students occupied the majority of accommodations, and energy consumption was the highest.When the university is closed for vacations, energy consumption is low.Figure 1 shows the two measured daily energy consumption profiles.The long vacations take place from mid-July to mid-September, while the inter-semester vacations take place in February.The highest demand was 8.066 kW, while the lowest was 1.7 kW.

Solar resource assessment
Cameroon receives abundant sunshine across its territory.Despite being situated in the southern region, Buea receives ample sunlight, which makes it suitable for the implementation of photovoltaic systems.Figure 2 displays the monthly solar radiation data and monthly average ambient temperature, acquired from 28 .

Proposed hybrid renewable energy system
The autonomous HRES consisted of solar photovoltaic panels, lithium batteries, and a diesel generator is shown in Fig. 3.

Mathematical modeling of renewable system
PV solar system Equation (1) provides the power generated by the photovoltaic system 29,30 .
(1) www.nature.com/scientificreports/where, P STC represents the nominal power of the solar panel, N PV indicates the number of solar panels, Ir is the solar radiation at the chosen location, T C stands for the cell temperature, α p indicates the temperature coefficient and F losses quantifies the reduction in efficiency of solar panels caused by factors such as dirt and shading.In this study, this variable was assigned a value of 0.95 31 .
The temperature T C of the cells is determined by solar radiation, the ambient temperature, and the normal operating cell temperature ( NOCT).

Diesel generator
The quantity of fuel used by a diesel generator significantly impacts its performance.This study assumes a linear fuel consumption curve, as referenced in 32 .Equation (3) calculates the fuel consumption per hour ( D f (t)).
(2)  where the diesel generator's nominal capacity is denoted by P Dgr , while the power generated at time t is rep- resented by P Dg .The fuel curve's slope α D is expressed in L/kW, and its intercept coefficient is denoted by β D .The values of α D and β D considered in this study were 0.246 and 0.08145 respectively 32 .The diesel generator is assumed to run at least 30% of its rated capacity for the purposes of this study.The lifespan of the diesel generator is determined by the number of hours it runs per year.Equations ( 4) and ( 5) represent the running time ( RT Diesel ) and the lifespan of the diesel generator, respectively.

Storage system
The battery system has two modes.
Charging mode.Surplus energy is utilized for charging the batteries.The battery-charging power was calculated using two equations.
If production (PV system and diesel generator) surpasses demand and the diesel generator's output alone is insufficient to meet demand, Eq. ( 6) is used to calculate how much energy needed for charging the batteries 63,64 .
When the power produced by the diesel generator is higher than the load demand, Eq. ( 7) is utilized to charge the batteries.
The inverter under consideration is bidirectional, with the assumption that its efficiency is the same in both DC/AC and AC/DC conversion modes.
Discharging mode.Batteries are discharged when the PV panels and/or diesel generator are unable to meet the entire load requirement 61 .
The energy available in the batteries is given by Eq. ( 9) 33 .
In Eqs. ( 6)-( 9), the symbols η ch and η dis are used to represent the battery charging efficiency and battery discharging efficiency, respectively.The inverter conversion efficiency is represented by η inv , while the nominal battery capacity is denoted as E max bat .The minimum energy quantity is referred to as E min bat , and the battery selfdischarge is represented by σ .The minimum battery energy depends on the depth of discharge (DOD).By utilizing Eq. ( 10), the value can be computed.
The amount of energy available over time in the batteries is constrained by the following factors:

Inverters
The DC/AC converter has to be capable of supplying the power required by the load.
Here, P invn denotes the inverter's rated power, and k SF is a safety factor that must be greater than one.

Reliability model
The metric employed to evaluate the reliability of the HRES is the loss of power supply probability (LPSP), which measures the probability of power supply failure.The Loss of Power Supply Probability (LPSP) criterion has been used in numerous studies 34,35 .This criterion is essential for evaluating the reliability of Hybrid Renewable Energy Systems (HRESs), as it measures the probability that the system will fail to meet the energy demand 36,37 .Equation ( 13) was employed to compute this criterion in this study 38,39 .

Economics models
The economic feasibility of the new hybrid system was evaluated based on two criteria: total annualized cost (TAC) along with the cost of energy (COE).

The total annualized cost (TAC)
The total annualized cost of the HRES encompass the initial capital expenditure required for its installation ( C CAP ), the cost associated with replacing the batteries and diesel generator ( C REP ), and the ongoing operational and maintenance costs ( C O&M ) for all components of the HRES 40,41 .
The TAC is calculated for each component of the HRES.
PV system.The total yearly cost of the photovoltaic system encompasses solely the initial cost ( C PV cap ) and the yearly expenses for maintenance and operation ( C PV O&M .), as the solar panels' lifespan aligns with the project's lifespan.
The CRF , which stands for capital recovery factor, is determined by utilizing Eq. ( 16).
where r represents the real interest rate while N denote the duration of the project.
The real interest rate is calculated based on the nominal interest rate i n and the inflation rate i f 42 .
Batterie system.The total annualized cost of the batteries includes the cost of the capital C Bat cap , required for installing the batteries, the cost of replacing the batteries C Bat rep , and the costs of operating and maintaining the batteries C Bat O&M 58,59 .k r represents the discount factor for component replacement cost.It is determined by the project lifespan, real interest rate, and component lifespan.Equation (19) describes this expression.
where N rep is the number of component replacements and n is the lifetime of the component.
Diesel generator.The overall cost of the diesel generator takes into account the initial investment, the expenses for maintenance and operation, as well as the fuel costs ( Cost fuel ).The calculation was made using Eq.(20).
Inverter.The TAC of the inverter encompasses the initial capital, subsequent replacement costs, and ongoing maintenance and operational costs.

Cost of energy (COE)
The cost of energy is calculated by dividing the total annualized cost by the amount of energy delivered to the load ( Energy served ).Equation ( 22) is utilized to calculate it 43,44

Optimization problem
The single-objective optimization problem is to minimize the energy cost of the HRES.The problem of optimization is mathematically represented by Eq. ( 23).
This single objective optimization problem is subject to the constraints presented in Eq. (24).

N L
PV , E L Bat , P L diesel represent the lower bounds of the optimization variables.N U PV , E U Bat , P U diesel , represent the upper bounds of the optimization variables.

Crayfish optimization algorithm (COA)
The Crayfish Optimization Algorithm (COA) is a computational model that emulates the behavioral patterns of crayfish, specifically focusing on their resorting, competitive, and foraging abilities.To ensure equilibrium between the algorithm's exploration and operation, the three behaviors were segregated into three separate stages 62 .The sequential procedures involved in the COA for addressing optimization problems are outlined in reference 45 : Step 1 Setting parameters and initializing the population.
The values for the number of iterations (T), population (N), dimension (dim), and upper and lower bounds (ub, lb) are established.Establish the initial population X by considering the upper and lower bounds.The population initialization is determined using Eqs.( 25) and (26).
Here, the variable X denotes the initial population, X i,j denotes the position of individual i within dimension j , lb j and ub j represent the lower and upper limits of dimension j, and the variable rand is a randomly generated number 65 .
Step 2 Setting the temperature.Equations ( 27) and ( 28) specify the ambient temperature ( temp ) of the crayfish, which influences the progres- sion of COA through different stages.
Here, the variable µ denotes the ideal temperature for crayfish, while σ and C 1 govern the consumption of crayfish at different temperatures.
Step 3 Summer resort and competition stages.
If temp > 30 and rand drops below 0.5, the COA transitions to the resort stage.The COA computes a new position ( X t+1 i,j ) by utilizing the cave position ( X shade ) and crayfish position ( X t i,j ).Equations ( 29), (30), and (31) allow computation of the new position.Next, we proceed to Step 5.  Here, X G indicates the current optimal position attained after a specific number of iterations, X L indicates the current population's optimal position, t denotes the present iteration's number and t + 1 denotes the iteration number for the following generation.C 2 exhibits a declining trend.
The COA entered the competitive phase when temp > 30 and rand was 0.5 or higher.Currently, the two crayfish engage in a competition for the cave by utilizing Eqs. ( 32) and (330.This competition leads to the establishment of a new position, denoted as X t+1 i,j , which is determined by the cave position ( X shade ) and the positions of the two crayfish ( X t i,j , X t z,j ).Then proceed to Step 5.
Here, z represents a randomly selected crayfish individual.
If temp ≤ 30 , the COA transitions into the foraging phase, where the consumption of food p and the size of the food Q are determined by Eqs. ( 34) and ( 35) 60 .
If Q < (C 3 + 1)/2 , use Eq. ( 38) to find a new position and move on to Step 5.
Step 5 Evaluation function.Assess the population and decide if to break the cycle.Otherwise, go back to Step 2.
Step 6 Displaying the optimal fitness value.
Table 1.Setting parameters for the four algorithms.

Other algorithms
The WOA 46 , SCA 47 , and GOA 48 are three additional meta-heuristics employed to address this optimization problem.
The initial settings of the algorithms are displayed in Table 1.

Energy management of the hybrid system
The most suitable design of the hybrid renewable energy system is heavily dependent on the strategic management of power flow between demand and the two sources of energy production, which include batteries.Solar panels are the primary source of power for meeting load demand, with lithium batteries serving as a secondary option.The diesel generator serves as a backup energy source, providing power to the load only when the PV system and batteries are unable to do so.This reduces the emission of greenhouse gases into the environment.The various stages of the energy management strategy are as follows: 1.If P PV (t) = P Load (t) η inv , the solar panels' generation is adequate to meet the load demand.2. If P PV (t) > P Load (t) η inv , excess energy is utilized for the purpose of charging the batteries.3.If P PV (t) < P Load (t) η inv , the state of charge of the battery is assessed.
-If the amount of energy stored in the battery at the preceding moment is adequate to satisfy the demand P PV (t) , then the batteries are discharged.-Insufficient energy stored in the batteries triggers the activation of the diesel generator to supply the required power for the load, and any surplus energy will be utilized to recharge the batteries.-In the event that the diesel generator is incapable of meeting the entirety of the load demand, and the battery state-of-charge does not meet the minimum threshold established by the DOD, the combined efforts of the diesel generator and the diesel generator and batteries work together to fulfill the entire load demand.-The energy management applied to the proposed HRES is depicted in Fig. 4.

Result and discussion
Figure 5 displays the meteorological data for Buea, including hourly solar radiation and hourly ambient temperature over a 1-year timeframe 53 .
Two different hybrid renewable energy configurations were tested to determine the best configuration.These are the PV-Battery-Diesel and PV-Battery configurations.Four metaheuristics are used to find the best size for each HRES configuration.Next, the best results for each configuration are compared.Figure 6 depicts the results of using the four metaheuristics to solve optimization problems.
In accordance with the results depicted in Fig. 6, the COA algorithm yielded the best outcomes irrespective of the HRES type being evaluated.The costs of energy determined with the four algorithms for the PV-Battery hybrid option converge to their optimal values as the number of iterations increases.Using the COA, WOA, SCA, and GOA algorithms, respectively, COEs of 0.1599 $/kWh, 0.16 $/kWh, 0.1601 $/kWh, and 0.1615 $/kWh were determined.Furthermore, the energy costs of the COA algorithm were reduced by 0.06%, 0.12%, and 1% compared to the energy costs achieved using the WOA, SCA, and GOA algorithms, respectively.
In the context of the PV-Battery-Diesel hybrid option, the COA algorithm demonstrated superior performance, yielding COEs of 0.1530$/kWh, 0.1531$/kWh, 0.1532$/kWh, and 0.1536$/kWh when the COA, WOA, SCA, and GOA algorithms were employed, respectively.It can be observed that the energy costs of the COA algorithm are 0.065%, 0.13%, and 0.39% less compared to the WOA, SCA, and GOA algorithms, correspondingly.In both the PV-Lithium Battery and PV-Lithium Battery-Diesel hybrid system configurations, the superior performance of the COA technique was observed compared to the WOA, SCA, and GOA algorithms.Figure 6 depicts the comparison of the results produced by the COA algorithm for the two configurations.
After conducting a comparative analysis of the optimal outcomes for each configuration, it came out that the PV-Battery-Diesel system exhibited superior performance with regard to both cost of energy and total annualized cost.The COE for the PV-Battery System was 0.1599 $/kWh, while the PV-Battery-Diesel System had a COE of 0.153 $/kWh.The COE achieved for the PV-Battery-Diesel system was 4.5% less compared to the PV-Battery system.Additionally, the total annualized cost (TAC) achieved using the PV-Battery configuration was $4444.90, while the PV-Battery-Diesel configuration yielded a TAC of $4251.98.Nevertheless, the PV-Battery-Diesel system releases a total of 1409.6 kg of carbon dioxide annually, based on a CO2 emission rate of 1.94 kg/kWh 54 , as a result of employing a diesel generator.
The PV-Battery-Diesel configuration exhibited superior economic performance compared to the PV-battery configuration.Prior research has yielded similar findings 55,56 .Regarding the COE obtained in this study compared to those reported in the literature, there is a wide range of results depending on the geographical location of the case study, the type of load profile, and the economic parameters taken into account for the analysis.For example, research conducted in China 57 resulted in a COE of $0.26/kWh.However, in reference 52 , the cost of energy for a specific study conducted in Iraq was $0.152/kWh.The COE achieved in this study is $0.153/kWh, which is within the same range of values.
Table 3 presents the detailed results generated by each algorithm.Due to the main focus of minimizing energy costs, the PV-Lithium Battery-Diesel setup was selected, and the subsequent analysis exclusively concentrated on this configuration.
The effect of the gradual reduction in LPSP on COE was investigated.The goal is to investigate the potential cost implications of increasing the reliability of the PV-Battery-Diesel hybrid system.The COA algorithm is used to generate the results shown in Fig. 7.
As shown in Fig. 7, the gradual decrease in LPSP led to a gradual increase in COE from 0.153$/kWh for an LPSP of 0.998% to 0.1670 $/kWh for an LPSP of 0.009%.Table 4 presents the detailed results of the LPSP reduction in the COE.
The data in Table 4 show that as the LPSP decreases, there is a corresponding increase in the COE and the total annualized cost of the system.The rise in energy costs as LPSP approaches zero is due to the growth in the nominal capacity of the diesel generator.The diesel generator's nominal capacity increases from 1.76 at a 0.998% LPSP to 5.74 kW at a 0.009% LPSP.The findings indicated that the gradual decrease in LPSP primarily affected the rated capacity of the diesel generator.The solar PV system capacity ranged from 36.56 kW for 0.998% LPSP (LPSP < 1%) to 38.02 kW for 0.009% LPSP (LPSP < 0.01%).The storage system capacity showed minimal variation despite the decrease in LPSP.The renewable energy fraction decreased as LPSP decreased.The CO 2 emissions were approximately 1,953.6 kg for the 0.009% LPSP, in contrast to 1,409.6 kg for the 0.99% LPSP.By maintaining the LPSP results at 0.009% and aligning the nominal capacity of the diesel generator with the maximum load demand (8.066 kW), a system with complete reliability (LPSP = 0%) was achieved.Figure 8 shows the relationship www.nature.com/scientificreports/among diesel generator rated capacity, energy cost, and LPSP.This energy management strategy utilized a diesel generator as an energy backup system to minimize GHG emissions.
Increasing the rated capacity of the diesel generator in Fig. 8 results in a higher COE and a decrease in the LPSP towards zero.At a diesel generator rated power output of 8.066 kW, which represents the peak load demand, the LPSP dropped to zero and the energy cost was 0.1718 kWh.The findings of the study indicate that the diesel generator plays a significant role in enhancing the dependability of the hybrid system under investigation.A comprehensive examination of the outcomes acquired for LPSP < 1% and LPSP = 0% was conducted.Figure 9 illustrates the yearly amounts of energy generated/consumed by the PV, diesel, and battery systems.
When LPSP was 0%, the PV system produced 49.04 MWh annually.Of this, 16.92 MWh was surplus energy, 20.55 MWh was used for battery charging, and 11.57MWh was directly supplied to the load by the solar panels through the inverter.The battery supplied 16.66 MWh of energy to the load via the inverter annually, while the diesel generator produced 1.042 MWh of energy per year.The annual energy demand was 27.80 MWh.The diesel generator provides approximately 3.7% of the total annual energy demand.
When LPSP was 0.99%, the PV system produced 47.26 MWh annually.Of this, 15.2 MWh was surplus energy, 20.32 MWh was used to charge the batteries, and 11.70 MWh was directly supplied to the load via the inverter.The diesel generator produced 0.727 MWh of energy annually, while the battery supplied 16.52 MWh of energy to the load through the inverter.The diesel generator provided approximately 2.6% of the overall annual energy demand.
The annual generation of the diesel generator was minimal compared to the energy produced by the solar panels and batteries in the two LPSPs analyzed.The energy management strategy implemented in this study aimed to optimize the utilization of renewable energy sources instead of diesel.The diesel generators ran for 441 h and consumed 241.96L of diesel with LPSP = 0.99%, whereas they ran for 348 h and consumed 485.91 L of diesel with LPSP = 0%.
Figures 10 and 11 show the energy production of the PV system, battery charging/discharging energy, and diesel generator for LPSP = 0% and LPSP = 0.99% over a 1-day period with minimal sunlight.Figure 10 illustrates that the diesel generator is utilized only when the storage system can no longer fulfill the demand in the LPSP = 0% scenario.Given that the LPSP is 0%, the nominal capacity of the diesel generator is adequate to fulfill all demands, resulting in no energy deficit.Conversely, when the LPSP is 0.99% (LPSP < 1%), the nominal capacity of the diesel generator is significantly lower than demand.When the batteries can no longer meet the demand, an energy deficit occurs, as shown in Fig. 11.
Figure 11 demonstrates that the diesel generator is utilized more when LPSP is 0.998% compared to when it is zero.In the 0.998% LPSP scenario, the diesel generator operated for a greater duration compared to the zero LPSP scenario.

Conclusion and future research directions
In conclusion, this study explored the optimization of an autonomous hybrid renewable energy system for residential use in Buea, Cameroon.The optimal dimensions of a HRES intended for residential use were investigated in this study.The evaluation involved two hybrid system configurations: PV-Battery and PV-Battery-Diesel.The techno-economic decision criterion selected for the single-objective optimization problem was the cost of energy (COE), while the dependability constraint used was the loss of supplied power probability (LPSP).To optimize and compare the two hybrid system configurations, the COA algorithm was employed.A comparison was made between the outcomes of the COA algorithm and those of established algorithms such as the WOA, SCA, and GOA.Based on the findings, the algorithms yielded energy costs of 0.1599$/kWh, 0.160$/kWh, 0.1601$/kWh, and 0.1615$/kWh for the COA, WOA, SCA, and GOA configurations, respectively.Compared to the COE produced by the WOA, SCA, and GOA algorithms, the COE derived from the COA algorithm is 0.06%, 0.12%, and 1% lower.In a similar vein, the algorithms yield COE values of 0.1530 $/kWh, 0.1531 $/kWh, 0.1532 $/ kWh, and 0.1555 $/kWh for the COA, WOA, SCA, and GOA configurations, respectively.The COE achieved through the COA algorithm was 0.065%, 0.13%, and 0.39% less than the COEs achieved from the WOA, SCA, and GOA algorithms, separately.Upon comparing the optimal outcomes yielded by the COA algorithm for the two hybrid system configurations, it was Witnessed that the PV-Battery-Diesel configuration exhibited the most favorable coefficient of efficiency (COE).Furthermore, an analysis of the effect of gradually decreasing LPSP on COE in the PV-Battery-Diesel configuration revealed that COE tends to rise as LPSP decreases.The rise in the COE can be attributed to an augmentation in the nominal capacity of the diesel generator.Therefore, once the diesel generator's nominal capacity reached the highest energy demand, the hybrid system achieved full reliability, with LPSP = 0.
In considering future research directions, several promising paths emerge to advance the field of hybrid renewable energy systems.Firstly, exploring advanced optimization techniques such as genetic algorithms, particle swarm optimization, or machine learning-based approaches could refine HRES design and operation.Secondly, integrating emerging technologies like advanced energy storage systems and smart grid technologies into HRES could enhance system performance and reliability.Thirdly, investigating the socio-economic impacts and policy implications of HRES deployment, along with field studies and pilot projects, can provide valuable insights into the practical feasibility and benefits of renewable energy adoption.By addressing these areas, future research can contribute to the development of innovative solutions for sustainable energy provision and accelerate the transition towards a low-carbon and resilient energy future.

Figure 1 .
Figure 1.Hourly load profile during vacation period and during normal period.

Figure 2 .
Figure 2. Buea monthly solar radiation data and monthly average ambient temperature.

Figure 3 .
Figure 3. Layout of the proposed HRES.

Figure 4 .
Figure 4. Proposed energy management strategy for the HRES.

Figure 5 .
Figure 5. Hourly solar radiation and ambient temperature for the city of Buea.

Figure 8 .Figure 9 .
Figure 8. Impact of the size of diesel generator on COE and LPSP.

Table 3 .
Results obtained for the two configurations under consideration.

Table 4 .
Impact of LPSP reduction on COE.